package com.example.feign;

import com.tedu.pojo.User;
import com.tedu.utll.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user-services")
public interface UserClient {

    //获取用户
    @GetMapping("/{userId}")
    public JsonResult<User> getUser(@PathVariable Integer userId) ;

    /**
     * 增加积分
     * @param userId
     * @param score
     * @return
     */
    @GetMapping("/{userId}/score")
    public JsonResult addScore(@PathVariable Integer userId, @RequestParam("score") Integer score);
}
